package P1000;

import java.util.Scanner;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-10-09 18:35
 */
public class P1028_数的计算 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.close();
        invoke(n);
    }

    private static void invoke(int n) {
        int[] dp = new int[n+1];
        dp[1] = 1;//终结条件
        System.out.println(count(n,dp));
    }

    private static int count(int n,int[] dp){
        if(dp[n] != 0) return dp[n];
        int div = n/2;
        for(int i=1;i<=div;++i){
            dp[n] += count(i,dp);
        }
        return ++dp[n];
    }
}
